package com.muc.plugin.vo;

import java.util.HashMap;
import java.util.Iterator;

public class PubEntity {

    private HashMap<String, Object> hashMap;

    public HashMap<String, Object> getHashMap() {
        return this.hashMap;
    }

    public void setHashMap(HashMap<String, Object> hashMap) {
        this.hashMap = hashMap;
    }

    public void setValue(String key,Object value){
        if(hashMap == null )
            hashMap = new HashMap<String, Object>();
        hashMap.put(key, value);
    }

    public Object getColumnValue(String column_name) throws Exception {
        if (hashMap != null && hashMap.size() > 0) {
            if (this.hashMap.containsKey(column_name)) {
                return this.hashMap.get(column_name);
            }
            throw new Exception("not key ：" + column_name + " is value！");
        }
        return null;
    }

    public Iterator<String> getColumnNames() {
        if (hashMap != null && hashMap.size() > 0)
            return this.hashMap.keySet().iterator();
        return null;
    }

}
